package com.qf.pojo;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;
import java.util.LinkedList;
import java.util.List;

/**
 * @author 高圆圆
 * @date 2023/1/5 14:33
 * 订单实体
 */
//@Data  //setXXX()/getXXX()/toString (需要将list集合打印,可能StackOverFlowException)
@NoArgsConstructor
@AllArgsConstructor
public class Order {

    /**
     *
     oid    varchar(32) NOT NULL
     ordertime  datetime NULL
     total  double NULL
     state  int(11) NULL
     address    varchar(30) NULL
     name   varchar(20) NULL
     telephone  varchar(20) NULL
     uid    varchar(32) NULL
     */
    private String oid  ;//订单编号
    private Date ordertime ;//下订单时间
    private double total ; //订单总金额
    private int state  ;//订单支付状态 默认是0,未支付,1 已支付
    private String address ; //订单收货地址
    private String name ; //姓名
    private String telephone; //电话
    private User user ; //订单所属的用户

    //订单包含很多订单项
    private List<OrderItem> items = new LinkedList<>() ;


    public String getOid() {
        return oid;
    }

    public void setOid(String oid) {
        this.oid = oid;
    }

    public Date getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(Date ordertime) {
        this.ordertime = ordertime;
    }

    public double getTotal() {
        return total;
    }

    public void setTotal(double total) {
        this.total = total;
    }

    public int getState() {
        return state;
    }

    public void setState(int state) {
        this.state = state;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getTelephone() {
        return telephone;
    }

    public void setTelephone(String telephone) {
        this.telephone = telephone;
    }

    public User getUser() {
        return user;
    }

    public void setUser(User user) {
        this.user = user;
    }

    public List<OrderItem> getItems() {
        return items;
    }

    public void setItems(List<OrderItem> items) {
        this.items = items;
    }
}
